<!-- 搜索表单 -->
<template>
     <el-form inline  :model="ruleForm" status-icon ref="ruleForm" label-width="100px" class="demo-ruleForm">
        <el-form-item label="账号" prop="account">
          <el-input prefix-icon="el-icon-document" v-model="ruleForm.account" clearable ></el-input>
        </el-form-item>
         <el-form-item label="用户名" prop="userName">
          <el-input v-model="ruleForm.userName" prefix-icon="el-icon-user" clearable></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="submitForm('ruleForm')">查询</el-button>
          <el-button @click="resetForm('ruleForm')">重置</el-button>
        </el-form-item>
      </el-form>
</template>

<script>
import { getUserListClickQuery } from '../../api/backstage'
import { getStore } from '../../storage/storage'
export default {
    name: "SearchForm",
  data () {
    return {
        ruleForm:{
            account: '',
            userName: '',
        },
    }
  },
  methods: {
      // 提交表单
    submitForm(){
        // 发送请求
        const params = {
            adminAccount: getStore("account"),
            account: this.ruleForm.account,
            userName: this.ruleForm.userName,
            page: 1,
            pageRow: 5,
        }
        getUserListClickQuery(params).then(res=>{
            this.userdata = res.data.data
        })
    },
    // 重置
    resetForm(formName) {
    this.$refs[formName].resetFields();
    },

  },
}
</script>

<style scoped>

</style>
